package day17.login.game;

import java.util.Scanner;

public class GuessNumber {
    private GuessNumber(){}

    public static void start() {
        
        int number = (int) (Math.random()*100)+1;

        while(true){
            Scanner sc = new Scanner(System.in);
            System.out.println("please input number:");
            int guessNumber = sc.nextInt();

            if (guessNumber > number) {
                System.out.println("大了：" + guessNumber);
            } else if (guessNumber < number) {
                System.out.println("小了：" + guessNumber);
            } else {
                System.out.println("success");
                break;
            }
        }
    }
}
